<dl class="dl-horizontal custom-field-input">
    <dt class="pull-left">
        <span uib-tooltip="{{$ctrl.field.description}}">{{$ctrl.field.name}}</span>
        <a ng-if="$ctrl.removable" class="pull-right mr-xxxs" href ng-click="$ctrl.removeCustomField($ctrl.id)" uib-tooltip="Delete">
            <i class="fa fa-trash text-danger"></i>
        </a>
    </dt>
    <dd ng-if="$ctrl.editable && $ctrl.field.options.length > 0">
        <updatable-select
            options="$ctrl.field.options"
            on-update="$ctrl.updateField(newValue)"
            value="$ctrl.value" clearable="true"></updatable-select>
    </dd>
    <dd ng-if="$ctrl.editable && $ctrl.field.options.length === 0" ng-switch="$ctrl.field.type">
        <div class="custom-field-input-wrapper">
            <updatable-simple-text ng-switch-when="string"
                input-type="text" on-update="$ctrl.updateField(newValue)" value="$ctrl.value" clearable="true"></updatable-simple-text>

            <updatable-date ng-switch-when="date" on-update="$ctrl.updateField(newValue)" value="$ctrl.value" clearable="true"></updatable-date>

            <updatable-simple-text ng-switch-when="integer"
                input-type="integer"
                on-update="$ctrl.updateField(newValue)"
                value="$ctrl.value" clearable="true"></updatable-simple-text>

            <updatable-simple-text ng-switch-when="float"
               input-type="float"
               on-update="$ctrl.updateField(newValue)"
               value="$ctrl.value" clearable="true"></updatable-simple-text>

            <updatable-boolean ng-switch-when="boolean"
                input-type="number"
                on-update="$ctrl.updateField(newValue)"
                value="$ctrl.value" clearable="true"></updatable-boolean>

            <span ng-switch-default>Not Editable</span>
        </div>
    </dd>
    <dd ng-if="!$ctrl.editable" ng-switch="$ctrl.field.type">
        <span ng-switch-when="date">{{$ctrl.value | shortDate}}</span>
        <span ng-switch-default>
            {{$ctrl.value}}
            <em class="text-warning" ng-if="!$ctrl.value">Not Specified</em>
        </span>
    </dd>
</dl>
